package week05;

import java.util.Random;

public class GraphicProxy implements Element{
    private  Graphic graphic;
    public GraphicProxy(Graphic graphic){
        this.graphic=graphic;
    }
    @Override
    public void draw(){
        Random rand =new Random();
        if(rand.nextBoolean()){
            System.out.println("成功");
            graphic.draw();
        }
        else{
            System.out.println("失败");
        }
    }
}
